/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package vodjaho.jms.util;

/**
 *
 * @author Maxim A. Kanev <ask.me.makes@gmail.com> [mkanev]
 */
public class MyUtil {

    public static void prettyStackPrint(Exception ex) {
        StackTraceElement elements[] = ex.getStackTrace();
        System.out.println("Exception occured:" + ex.toString());
        System.out.println("----------------------------------");
        for (int i = 0; i < elements.length; i++) {
            System.out.println("Class:" + elements[i].getClassName() + " in:" + elements[i].getFileName());
            System.out.println("Line:" + elements[i].getLineNumber() + " in:" + elements[i].getMethodName());
        }
        System.out.println("----------------------------------");
    }

}
